home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d14
/
baswind8.arc
/
DEMO1.BAS
< prev
next >
Wrap
BASIC Source File
|
1990-09-14
|
15KB
|
468 lines
'DEMO OF BASWIND7 MODULES AND BWTOOLS
'
' MODULE : DEMO1.BAS
'
' BY : James P. Morgan, 5226 Via Hacienda #115 Orlando FL, 32809
'
' Version 8.0, Sept 1990
'
CLOSE
CLEAR
' SCREEN 0,0,0
WIDTH 80
KEY OFF
COLOR 7,1
CLS
DEFINT A-Z
OPTION BASE 0
RETURN.CODE%=0
WinArraySize%=6000
DIM WinScreenArray%(WinArraySize%)
WinWaitForVerticalRetrace=0
WinActiveScreen=0
WinScreenSegment%=0
SCREEN.POINTER%=WinActiveScreen
WinScreenPointer%=0
'PUT UP OPENING SCREEN
'4 WINDOWS OF DIFFERENT COLORS AND A TITLE WINDOW
CALL MAKEWIND(5,15,13,45,4,4,3,0,1,"",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(4,36,15,75,3,15,2,0,1,"",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(10,10,21,50,2,0,5,0,1,"",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(13,42,22,78,1,3,12,0,1,"",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,20,14,60,2,0,7,0,1,"",RETURN.CODE%)
COLOR 0,7
LOCATE 11,35
PRINT"PRESENTING...";
SECONDS!=5.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,20,14,60,0,0,7,0,0,"",RETURN.CODE%)
CALL MAKEWIND(9,20,14,60,2,0,7,1,0,"",RETURN.CODE%)
LOCATE 10,33:PRINT"B A S W I N D 8"
LOCATE 12,26:PRINT" Windowing Routines for the"
LOCATE 13,26:PRINT"Microsoft QuickBASIC 4 Compiler"
SECONDS!=8.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(13,50,20,75,1,0,6,0,1,"",RETURN.CODE%)
COLOR 0,6
LOCATE 14,61:PRINT "By"
LOCATE 15,56:PRINT "James P. Morgan"
LOCATE 16,52:PRINT "5226 Via Hacienda #115"
LOCATE 17,55:PRINT "Orlando FL, 32809"
LOCATE 19,53:PRINT "based on PD works by"
LOCATE 20,59:PRINT "Dave Evers"
SECONDS!=10.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(8,25,15,55,2,7,1,1,0,"",RETURN.CODE%)
COLOR 15,1
LOCATE 8,35:PRINT "Including ..."
LOCATE 10,30:PRINT "*** Window Tools ***"
LOCATE 12,28:PRINT "A collection of routines"
LOCATE 13,28:PRINT "for integration into your"
LOCATE 14,28:PRINT "own programs.
SECONDS!=8.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(8,25,15,55,2,7,1,0,0,"",RETURN.CODE%)
LOCATE 8,25:PRINT " * * * * * * * * * * * * * "
LOCATE 10,28:PRINT "Stand by for a guided tour"
LOCATE 12,28:PRINT "through the many facets of"
LOCATE 14,28:PRINT "this exciting program."
SECONDS!=5.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CLS
CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
COLOR 0,7
LOCATE 10,18:PRINT "The basic purpose of BASWIND8 is to provide"
LOCATE 11,18:PRINT "the fundamental routines for implementing"
LOCATE 12,18:PRINT "simple 'windowing' into your QuickBASIC pro-"
LOCATE 13,18:PRINT "grams and providing MS Mouse support also. "
LOCATE 14,18:PRINT " With just a few simple statements, you can "
LOCATE 15,18:PRINT "'pop-up' a colored window onto the screen.."
SECONDS!=15.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(3,50,8,79,1,15,4,0,0,"",RETURN.CODE%)
SECONDS!=4.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
LOCATE 12,18:PRINT"The window can be a solid panel of any of
LOCATE 14,18:PRINT"the BASIC background colors; such as ..."
SECONDS!=4.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(2,3,8,35,0,1,2,0,0,"",RETURN.CODE%)
SECONDS!=4.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
LOCATE 12,18:PRINT"or it can be surrounded by a 'frame' in any"
LOCATE 13,18:PRINT"of four styles..."
SECONDS!=4.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(5,6,11,37,1,9,5,0,0,"Frame Style 1",RETURN.CODE%)
CALL MAKEWIND(8,9,14,40,2,12,3,0,0,"Frame Style 2",RETURN.CODE%)
CALL MAKEWIND(11,12,17,43,3,15,4,0,0,"Frame Style 3",RETURN.CODE%)
CALL MAKEWIND(14,15,20,46,4,0,6,0,0,"Frame Style 4",RETURN.CODE%)
SECONDS!=4.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
COLOR 7,1
CLS
CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
COLOR 0,7
LOCATE 10,18:PRINT "The frame itself can be in any one of the"
LOCATE 11,18:PRINT "BASIC foreground colors. It can even blink"
LOCATE 12,18:PRINT "if you want..."
SECONDS!=5.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
FOR I=0 TO 15
CLR%=I
LABEL$="Color:"+STR$(I)
CALL MAKEWIND(15,10,23,45,4,CLR%,5,0,0,LABEL$,RETURN.CODE%)
SECONDS!=.5
CALL WAITTIME(SECONDS!,RETURN.CODE%)
NEXT
FOR I=0 TO 15
CLR%=I+128 'ADD 128 FOR BLINKING FRAMES
LABEL$="Color:"+STR$(I+128)
CALL MAKEWIND(15,10,23,45,4,CLR%,5,0,0,LABEL$,RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
NEXT
COLOR 7,1
CLS
CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
COLOR 0,7
LOCATE 14,18:PRINT "The window itself can be presented in many"
LOCATE 15,18:PRINT "different ways. It can be flat..."
SECONDS!=4.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(2,2,11,32,1,15,4,0,0,"",RETURN.CODE%)
SECONDS!=4.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
LOCATE 12,20:print "or it can have a 'true' shadow underneath"
LOCATE 13,20:print " giving a three-dimensional effect... "
SECONDS!=5.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(2,35,11,55,2,15,5,0,1,"",RETURN.CODE%)
SECONDS!=10.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
COLOR 7,1
CLS
COLOR 0,7
CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
LOCATE 12,18:PRINT "For a particularly dramatic effect, the window"
LOCATE 13,18:PRINT "can 'grow' onto the screen..."
SECONDS!=3.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(8,10,17,70,2,15,4,1,0,"",RETURN.CODE%)
COLOR 15,1
LOCATE 12,37
PRINT "W O W !!!
SECONDS!=3.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
COLOR 0,7
LOCATE 10,18:PRINT "Once you have your window on the screen, simply"
LOCATE 11,18:PRINT "use LOCATE, COLOR, and PRINT statements to put"
LOCATE 12,18:PRINT "text in them. Another call with the same param-"
LOCATE 13,18:PRINT "eters as the first ...
SECONDS!=10.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
LOCATE 10,18:PRINT "will erase the window for new text. But suppose"
LOCATE 11,18:PRINT "that instead of clearing the window, you would"
LOCATE 12,18:PRINT "rather SCROLL the data inside either up or down,"
LOCATE 13,18:PRINT "and put a new line of text on either the top or"
LOCATE 14,18:PRINT "bottom line; as the case might be..."
SECONDS!=10.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,1," NEVER FEAR . . . ",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,1,"",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,1," The SCROLL routine will do just that! You can",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,1," scroll lines of text - ",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,1," UP",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,1," UP",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,1," UP",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,-1,"",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,-1,"",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,-1,"",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,-1," or DOWN",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,-1," DOWN",RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL SCROLL(9,15,16,65,1,-1," DOWN",RETURN.CODE%)
SECONDS!=2.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,15,16,65,2,0,7,1,0,"",RETURN.CODE%)
LOCATE 10,18:PRINT "just as easily as you can create the window!"
LOCATE 11,18:PRINT "In fact, all of the commands of BASWIND8 are"
LOCATE 12,18:PRINT "very easy to use. Here is a call to create"
LOCATE 13,18:PRINT "this window ..."
LOCATE 15,18:PRINT " CALL MAKEWIND(9,15,16,65,2,0,7,0,1,'')"
SECONDS!=10.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
LOCATE 11,18:PRINT "And this is the call used to perform the SCROLL"
LOCATE 12,18:PRINT "operation ..."
LOCATE 14,18:PRINT " CALL SCROLL(9,15,16,65,1,1,'')
SECONDS!=5.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
HERE:
' CLEAR
CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
LOCATE 10,18:PRINT "An even simpler command allows you to save the"
LOCATE 11,18:PRINT "contents of the screen into an integer array;"
LOCATE 12,18:PRINT "so that you can place a window on the screen"
LOCATE 13,18:PRINT "and then quickly remove it; leaving the under-"
LOCATE 14,18:PRINT "lying information as it was. Here is a good"
LOCATE 15,18:PRINT "example . . ."
WinActiveScreen=0
WinScreenSegment%=VARSEG(WinScreenArray%(0))
SCREEN.POINTER%=2000%*WinActiveScreen
WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
'
' The screen save areas MUST be defines as DYNAMIC array, therefore the
'segment address and offset of memory block MUST be passed to .asm routines
'
CALL SAVESCRN(WinWaitForVerticalRetrace,_
WinScreenSegment%,_
WinScreenPointer%,RETURN.CODE%)
SECONDS!=10.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(4,4,13,42,4,0,2,0,1,"",RETURN.CODE%)
LOCATE 9,10
COLOR 0,2
PRINT "This is the first level ..."
SECONDS!=3.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
WinActiveScreen=1
WinScreenSegment%=VARSEG(WinScreenArray%(0))
SCREEN.POINTER%=2000%*WinActiveScreen
WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
CALL SAVESCRN(WinWaitForVerticalRetrace,_
WinScreenSegment%,_
WinScreenPointer%,RETURN.CODE%)
CALL MAKEWIND(7,30,18,79,4,15,4,0,1,"",RETURN.CODE%)
LOCATE 12,40
COLOR 15,4
PRINT "This is the second level ..."
SECONDS!=3.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
WinActiveScreen=2
WinScreenSegment%=VARSEG(WinScreenArray%(0))
SCREEN.POINTER%=2000%*WinActiveScreen
WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
CALL SAVESCRN(WinWaitForVerticalRetrace,_
WinScreenSegment%,_
WinScreenPointer%,RETURN.CODE%)
CALL MAKEWIND(10,25,22,55,4,12,3,0,1,"",RETURN.CODE%)
LOCATE 16,27
COLOR 12,0
PRINT "This is the third level ..."
SECONDS!=3.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
LOCATE 16,27
PRINT "Now to go back ... "
SECONDS!=2.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
WinActiveScreen=2
WinScreenSegment%=VARSEG(WinScreenArray%(0))
SCREEN.POINTER%=2000%*WinActiveScreen
WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
'
' The screen save areas MUST be defines as DYNAMIC array, therefore the
'segment address and offset of memory block MUST be passed to .asm routines
'
CALL RESTSCRN(WinWaitForVerticalRetrace,_
WinScreenSegment%,_
WinScreenPointer%,RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
WinActiveScreen=1
WinScreenSegment%=VARSEG(WinScreenArray%(0))
SCREEN.POINTER%=2000%*WinActiveScreen
WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
CALL RESTSCRN(WinWaitForVerticalRetrace,_
WinScreenSegment%,_
WinScreenPointer%,RETURN.CODE%)
SECONDS!=1.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
WinActiveScreen=0
WinScreenSegment%=VARSEG(WinScreenArray%(0))
SCREEN.POINTER%=2000%*WinActiveScreen
WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
CALL RESTSCRN(WinWaitForVerticalRetrace,_
WinScreenSegment%,_
WinScreenPointer%,RETURN.CODE%)
SECONDS!=3.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
COLOR 0,7
LOCATE 9,18:PRINT "The basic routines in the BASWIND8 package"
LOCATE 10,18:PRINT "give you all you need to create some power-"
LOCATE 11,18:PRINT "ful 'toolbox' modules to integrate into your"
LOCATE 12,18:PRINT "programs and NOW with MS Mouse support also."
LOCATE 14,18:PRINT " To see what more awaits you, just run the "
LOCATE 15,18:PRINT " DEMO2 program, and have your mouse ready !! "
SECONDS!=12.0
CALL WAITTIME(SECONDS!,RETURN.CODE%)
LOCATE 25,1
' END
'==============================================================================